<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<TheWorldsWorst.ApiWrapper.Model.User>" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title><%= Model.Name %></title>
    <link rel="Stylesheet" href="../../Content/Site.css" />
</head>
<body>
    <div>
        <a href="/"><img style="border-style: none" src="../../Content/img/logo.png" /></a>
    </div>
    <div class="user-info">
        <div>
            <h1><%= Model.Name %></h1>
            <img alt="Gravatar" src="<%= Model.Gravatar %>" /><br />
            <%= Model.Reputation.ToString("N0") %> <a href="/RepGraph/<%= Model.UserId %>">(graph)</a><br />
            <a href="/deck?userId=<%= Model.UserId %>">Follow Me!</a>
        </div>
        <div class="user-about">
        <%= Model.AboutMe %>
        </div>
        <% if (Model.AcceptRate.HasValue)
           { %>
            <div><%= Model.AcceptRate %>% Acceptance Rate</div>
        <% } %>
        <a href="/useractivity/<%= Model.UserId %>">Recent Activity</a>
    </div>
    
    <div>
    <h2><%= Model.QuestionCount %> Questions</h2>
    <% foreach (var q in Model.Questions)
       { %>
            <div class="question" id="question-<%= q.QuestionId %>">
                <div>
                    <div class="favorites"><%= q.FavoriteCount %></div>
                    <div class="votes"><%= q.Score %></div>
                    <div class="views"><%= q.ViewCount.ToString("N0") %></div>
                </div>
                <div id="question-<%= q.QuestionId %>-title"><a href="/question/<%=q.QuestionId %>"><%= q.Title %></a></div>
                <% foreach (var tag in q.Tags)
                   { %>
                    <span class="tag"><%= tag %></span>
                <% } %>
                <span class="user"><a href="/users/<%= q.OwnerUserId %>"><%= q.OwnerDisplayName %></a></span>
            </div>
    <% } %>
    </div>
    
    <div>
    <h2><%= Model.AnswerCount %> Answers</h2>
    <table border="0">
    <% foreach (var a in Model.Answers)
       { %>
        <tr><td>
            <div class="votes"><%= a.Score %></div>
            <a href="/question/<%= a.QuestionId %>#<%=a.QuestionId %>"><%= a.Title %></a>
        </td></tr>
    <% } %>
    </table>
    </div>
    
    <div>
    <h2><%= Model.UpVotes + Model.DownVotes %></h2>
    <div><%= Model.UpVotes %> Up Votes</div>
    <div><%= Model.DownVotes %> Down Votes</div>
    </div>
    
    <div>
    <h2><%= Model.Tags.Count() %> Tags</h2>
        <% foreach(var t in Model.Tags)
           { %>
            <div><a href="/tags/<%= t.Name %>"><span class="tag"><%= t.Name %></span></a>x <%=t.Count %></div>
        <% } %>
    </div>
    
    <div>
    <h2><%= Model.TotalBadges %> Badges</h2>
        <% foreach (var b in Model.Badges)
           {
               var c = b.Class.ToString().ToLower();
               %>
               <a href="/badges/<%= b.BadgeId %>">
                <span class="badge-<%= c %>"><%= b.Name %></span>
               </a>
        <% } %>
    </div>
</body>
</html>